

.animate {
    font-size: 40px;
    margin: 100px 0 0;
  }
  .animate span {
    display: inline-block;
  }
  .box span {
    color: red;
    opacity: 0;
    transform: translate(-150px, 0) scale(.5);
    animation: leftRight 3s infinite;
  }
  @keyframes leftRight {
    40% {
      transform: translate(30px, 0) scale(.7);
      opacity: 1;
      color:blue;
    }
    60% {
      color: black;
    }
    80% {
      transform: translate(0) scale(2);
      opacity: 0;
    }
    100% {
      transform: translate(0) scale(1);
      opacity: 1;
    }
  }